const fs = require('fs')
const path = require('path')

const modules = require('./modules/index')
const dest = process.cwd()
const template = path.join(__dirname, '../templates')


module.exports = function(moduleName, data, dir) {
  try {
    modules[moduleName](template, dest, data, dir)
  } catch (err) {
    throw err
  }
}